from urllib.parse import urlsplit

url = 'https://npcitem.jd.hk/72040202995.html#crumb-wrap'

path = urlsplit(url).path.strip('/.html')
print(path)